var mongoose = require('mongoose')
mongoose.connect('mongodb://localhost/todomvc',{useNewUrlParser: true})

var Schema = mongoose.Schema
var itemSchema = new Schema({
// {id:1,content:'aaaa',completed:false},
	"id":Number,
	"content":String,
	"completed":Boolean
})
mongoose.connection.on("connected",() => {
	console.log("connected success")
})
mongoose.connection.on("error",()=>{
	console,log("connected error")
})
mongoose.connection.on('disconnected',()=>{
	console,log("connected disconnected")
})

module.exports = mongoose.model('Item',itemSchema)
